export default {
    namespaced: true,
    state: {
        statusBarHeight: 0
    },
    mutations: {
        setParams (state, params) {
            for (const [key, value] of Object.entries(params)) {
                if (state.hasOwnProperty(key)) {
                    state[key] = value
                }
            }
        }
    },
    actions: {
        getSystem ({ commit }) {
            uni.getSystemInfo({
                success: res => {
                    const { statusBarHeight } = res
                    commit('setParams', {
                        statusBarHeight
                    })
                }
            })
        }
    },
};